﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LinqToBing.Bing.Wrapper.Search;

namespace LinqToBing.Bing.Wrapper.Common
{
    /// <summary>
    /// Class containing the constants that identifies Xml Schema used from Bing for the different search response.
    /// </summary>
    public class XMLNS
    {
        public const string BingXSD_base_url = "http://schemas.microsoft.com/LiveSearch/";
        public static readonly string BingXSD_commonheader_SearchResponse = string.Format("{0}2008/04/XML/element", BingXSD_base_url);
        public static readonly string BingXSD_Web_SearchResponse_web = string.Format("{0}2008/04/XML/multimedia", BingXSD_base_url);
        public static readonly string BingXSD_Image_SearchResponse_mms = string.Format("{0}2008/04/XML/multimedia", BingXSD_base_url);
        public static readonly string BingXSD_News_SearchResponse_news = string.Format("{0}2008/04/XML/news", BingXSD_base_url);
        public static readonly string BingXSD_InstantAnswer_SearchResponse_ia = string.Format("{0}2008/04/XML/instantanswer", BingXSD_base_url);
        public static readonly string BingXSD_Spell_SearchResponse_spl = string.Format("{0}2008/04/XML/spell", BingXSD_base_url);
        public static readonly string BingXSD_Phonebook_SearchResponse_pho = string.Format("{0}2008/04/XML/phonebook", BingXSD_base_url);
        public static readonly string BingXSD_RelatedSearch_SearchResponse_ = "";
        public static readonly string BingXSD_Ad_SearchResponse_ = "";

        public static string GetValidatingXsd(object obj)
        {
            Type t = obj.GetType();
            if (t is SearchResultWeb)
            {
                return BingXSD_Web_SearchResponse_web;
            }
            return BingXSD_base_url;
        }
    }
}
